import ShaderLib from "../ShaderLib";

export default class CrossBeamShader {
    public static getVertexShader() {
        return ShaderLib.getDefaultVertexShader();
    }

    public static getFragmentShader() {
        let shader = `
        #include <common>
        #include <fog_pars_fragment>
        #include <logdepthbuf_pars_fragment>
        varying vec2 uvTexcoord;
        uniform float time;
        uniform float width;
        uniform float height;
        uniform vec3 v_color;
  
        void main(){                 
            vec2 uv = uvTexcoord;
            float timeAdjust = 3.1415926;
            float intensity = (abs(sin(uv.x * 30.0 + time*timeAdjust)) + abs(cos(uv.x * 10.78 + time*timeAdjust * 1.75)) + abs(sin(uv.x * 15.11 - time*timeAdjust * 2.3))) / 3.0;
            float mask = cos((uv.x - 0.5) * 3.14) * cos((uv.y - 0.5) * 3.14);
            gl_FragColor= vec4(v_color.rgb * intensity ,mask*intensity);
            #include <fog_fragment>
        }
        `;
        return shader;
    }

}
